package del2;

public class Person {
	private int age;

	public Person(){
		age = 22;
	}
	
	public void setAge(int age) throws Exception
	{
		if (age < 0){
			throw new Exception("Age can't be less than zero!");
		}
		else{
			this.age = age;
		}
	}
	
	/*
	 * throws a RuntimeException, may be illogical, but necessary for Main4.
	 */
	public void clearAge() throws RuntimeException{
		this.age = 0;
		throw new RuntimeException();
	}
	
	public void printAge(){
		System.out.println(age);
	}
	
}
